﻿
namespace Patterns4Net.ArchitectureExplorer.ViewModels.Messages
{
    /// <summary>
    /// Represents a generic error that has happen somewhere in the program.
    /// This message will be handled by displaying an error popup dialog.
    /// </summary>
    /// <remarks>
    /// Errors displayed in <see cref="ErrorsWindowViewModel"/> can be added using
    /// methods of <see cref="ErrorsWindowViewModel"/>, not by publishing this message.
    /// </remarks>
    public class ErrorMessage : MessageBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ErrorMessage"/> class, 
        /// use this constructor to create generic error with a message.
        /// </summary>
        public ErrorMessage(string message, bool showAsWarning = false)
        {
            this.Message = message;
            this.ShowAsWarning = showAsWarning;
        }

        public string Message { get; private set; }

        public bool ShowAsWarning { get; private set; }
    }
}
